<?
class errorController extends iMVC_Controller{

    public function index_before(){
    
}
    
    public function index(){
    
        $this->assign("error","error");
        $this->assign("values",$_GET["urlValue"]);
        $this->display("error.tpl");
    
    }
    public function validate(){
    
        $this->assign("baseUrl",$this->getBaseUrl());
        $vt=new iMVC_Validator($this->post);
        $vt->addRule('pass','{"requried":true,"equalTo":'.$abc.',"max-length":1,"min-length":1,"regRule":"/^2.*/"}','{"default":"出现错误","regRule":"正则错误"}');
        $vt->addRule('isNull','{"requried":true}','{"requried":"非空验证没通过"}');
        $vt->addRule('max','{"max-length":5}','{"max-length":"不能超过5个字符`"}');
        $vt->addRule('min','{"min-length":5}','{"min-length":"不能小于5个字符"}');
        $vt->addRule('email','{"email":true}','{"email":"请输入正确的email格式"}');
        //正则式中不能有反斜线\ jsonencode函数不支持 擦！
        $vt->addRule('regStr','{"regRule":"/[0-9]?help/"}','{"regRule":"正则匹配错误"}');
        if($vt->validate()){
            $this->assign("errors",$vt->getErrorList());
        }
        else{
        
            $this->assign("errors",array(1=>'所有验证都通过'));
        }
        $this->display("error.tpl");
    
    }

}
?>
